package resources.factories;

import java.io.File;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.ResourceBundle;

import core.molecules.atoms.Atom;



import util.XYZPosition;

public class AtomFactory extends MoleculeFactory<Atom>{



	public AtomFactory(String prefix, ResourceBundle rb) {
		super(prefix , rb);
	}


	@SuppressWarnings("unchecked")
	@Override
	protected <S extends Atom> S construct(Class<? extends Atom> value,
			Object[] args) throws IllegalArgumentException, SecurityException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
			
		if (args == null || args.length < 2)
			return (S) value.newInstance();
		
		return (S) value.getConstructor(XYZPosition.class, String.class, int.class).newInstance(args[0], args[1], args[2]);
	}
	
	
	
	


	

}
